import service from "../index";

export function register(data) {
    return service({
        url: '/customer/register',
        method: 'post',
        data
    })
}

export function login(data) {
    return service({
        url: '/customer/login',
        method: 'post',
        data
    })
}

// 人气推荐
export function getHotGoods(data) {
    return service({
        url: '/customer/homePage/popularRecommendations',
        method: 'post',
        data
    })
}

// 菜品分类列表
export function getGoodsType(data) {
    return service({
        url: '/customer/homePage/dishesList',
        method: 'post',
        data
    })
}

// 菜品分类
export function getCategoryList(data) {
    return service({
        url: '/customer/homePage/categoryList',
        method: 'post',
        data
    })
}

// 根据美食id获取商家信息
export function getShopInfo(params) {
    return service({
        url: '/dishesManagement/businessClientHome',
        method: 'post',
        params
    })
}

// 根据分类名字获取菜品列表
export function getGoodsList(params) {
    return service({
        url: '/dishesManagement/searchListByCategoryName',
        method: 'post',
        params
    })
}

// 新增地址
export function changeAddress(data) {
    return service({
        url: '/customer/address/addOrUpdateAddress',
        method: 'post',
        data
    })
}

// 获取地址列表
export function getAddressList() {
    return service({
        url: '/customer/address/addressList',
        method: 'post',
        
    })
}

// 删除地址
export function delAddress(params) {
    return service({
        url: '/customer/address/deleteAddress',
        method: 'post',
        params
    })
}

// 提交订单
export function submitOrder(data) {
    return service({
        url: '/customer/order/addOrder',
        method: 'post',
        data
    })
}

// 订单列表

export function orderList(data) {
    return service({
        url: '/customer/order/orderList',
        method: 'post',
        data
    })
}

// 获取用户信息
export function getUserInfo() {
    return service({
        url: '/customer/getPersonInfo',
        method: 'post'
    })
}

// 更新用户信息
export function updateUserInfo(data) {
    return service({
        url: '/customer/updatePersonInfo',
        method: 'post',
        data
    })
}

// 订单评价
export function addEvaluate(data) {
    return service({
        url: '/customer/evaluate/evaluate',
        method: 'post',
        data
    })
}

// 获取评价列表
export function getEvaluateList(data) {
    return service({
        url: '/customer/evaluate/evaluateListByBusinessId',
        method: 'post',
        params:data
    })
}